lib: short-circuit WebIDL BufferSource SAB check#62833
Open
panva wants to merge 1 commit intonodejs:mainfrom
Open
lib: short-circuit WebIDL BufferSource SAB check#62833panva wants to merge 1 commit intonodejs:mainfrom
panva wants to merge 1 commit intonodejs:mainfrom
Conversation
Collaborator
|
Review requested:
|
Renegade334
reviewed
Apr 19, 2026
Renegade334
reviewed
Apr 19, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #62833 +/- ##
==========================================
- Coverage 89.64% 89.63% -0.01%
==========================================
Files 706 706
Lines 219024 219150 +126
Branches 41960 41984 +24
==========================================
+ Hits 196338 196438 +100
- Misses 14587 14606 +19
- Partials 8099 8106 +7
🚀 New features to boost your workflow:
|
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
a136367 to
7e3be29
Compare
Member
Author
|
Why am I only seeing this in https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1829/ 🤔 It's still an improvement, but much less than what i'm looking at locally. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Avoid the C++
isSharedArrayBufferbinding call on the BufferSource and ArrayBufferView converter hot path by brand-checking the backing buffer via theArrayBuffer.prototype.byteLengthgetter: the getter succeeds on every real ArrayBuffer (the common case) and throws only on SharedArrayBuffers, mirroring the brand check V8 performs internally. This preserves the existing SharedArrayBuffer rejection semantics independent of the receiver's prototype chain, including pathological cases such as a SharedArrayBuffer whose prototype has been reassigned toArrayBuffer.prototype.Local:
CI Benchmark: #62833 (comment)
Bench pre a136367